﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Hosting;


namespace PageOffice6_Net_Core.Controllers.InsertSeal
{
    public class InsertSealController : Controller
    {
        private readonly IWebHostEnvironment _webHostEnvironment;

        public InsertSealController(IWebHostEnvironment webHostEnvironment)
        {
            _webHostEnvironment = webHostEnvironment;
        }

        public IActionResult Index()
        {
            return View();
        }


        public IActionResult Refresh()
        {

            //复制模板
            string webRootPath = _webHostEnvironment.WebRootPath;
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSeal1\\word1_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSeal1\\word1.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSeal2\\word2_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSeal2\\word2.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSeal3\\word3_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSeal3\\word3.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSeal4\\word4_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSeal4\\word4.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSeal5\\word5_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSeal5\\word5.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSeal6\\word6_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSeal6\\word6.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSeal7\\word7_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSeal7\\word7.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSeal8\\word8_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSeal8\\word8.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSeal9\\word9_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSeal9\\word9.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\DeleteSeal\\test_bak.doc", webRootPath + "\\InsertSeal\\Word\\DeleteSeal\\test.doc", true);

            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSign1\\word1_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSign1\\word1.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSign2\\test_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSign2\\test.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSign3\\test_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSign3\\test.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSign4\\test_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSign4\\test.doc", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\Word\\AddSign5\\word2_bak.doc", webRootPath + "\\InsertSeal\\Word\\AddSign5\\word2.doc", true);

            System.IO.File.Copy(webRootPath + "\\InsertSeal\\PDF\\AddSeal1\\test_bak.pdf", webRootPath + "\\InsertSeal\\PDF\\AddSeal1\\test.pdf", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\PDF\\AddSeal2\\test_bak.pdf", webRootPath + "\\InsertSeal\\PDF\\AddSeal2\\test.pdf", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\PDF\\AddSeal3\\hetong_bak.pdf", webRootPath + "\\InsertSeal\\PDF\\AddSeal3\\hetong.pdf", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\PDF\\DeleteSeal\\test_bak.pdf", webRootPath + "\\InsertSeal\\PDF\\DeleteSeal\\test.pdf", true);
            System.IO.File.Copy(webRootPath + "\\InsertSeal\\PDF\\AddSign1\\test_bak.pdf", webRootPath + "\\InsertSeal\\PDF\\AddSign1\\test.pdf", true);
            return View();
        }
    }
}
